<?php
// Adding is only allowed in overview view
if ($this->wb_db->get_addable() && ! $this->wb_db->get_in_trash())
	echo html::anchor($this->uri->rsegment(1).'/add', Kohana::lang('table.add'));

// Mass deletion is only allowed in overview view when trashing is not in use or in thrash view
if ($this->wb_db->get_deletable() && ($this->wb_db->get_in_trash() || ! $this->wb_db->get_trashable()))
	echo html::anchor('#', Kohana::lang('table.del_sel'), 'class="js_only del_sel"');

if ($this->wb_db->get_trashable()) :
	
	// if we're in trash view, we need to get back and possably allow mass deletion
	if ($this->wb_db->get_in_trash()) :
		echo html::anchor('#', Kohana::lang('table.untrash_sel'), array('class'=>"js_only untrash_sel"));
		echo html::anchor($this->uri->rsegment(1), Kohana::lang('table.overview'));
		
	// if we're in not trash view, we need to get back and possably allow mass deletion
	else :
		echo html::anchor('#', Kohana::lang('table.trash_sel'), array('class'=>"js_only trash_sel"));
		echo html::anchor($this->uri->rsegment(1).'/trashed', Kohana::lang('table.trashed'));
	endif;
endif;
